home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
MacApp
/
MacApp 3.0a2
/
Tools
/
Cheat Sheet
< prev
next >
Wrap
Text File
|
1991-05-01
|
1KB
|
88 lines
Failure Handler code:
FailInfo fi;
if (!fi.CatchFailure())
{
...Code to test.
fi.Success();
}
else
{ // Failure Handler.
...The failure handler code.
fi.ReSignal(); // Optional. Omit to continue.
}
Nested Procedure class:
typedef pascal void (*DoToObject) (TObject* theView, void* staticLink);
class CProcName {
// Fields
VPoint& aVPoint;
const VRect& aVRect;
public:
// Constructor
CProcName(VPoint& theVPoint, const VRect& theVRect):
aVPoint (theVPoint), aVRect (theVRect) {}
// Method
pascal void CProcName::DoProcName(TObject* theObject);
};
pascal void CProcName::DoProcName(TObject* theObject)
{
... Local Vars
... Code
}
Switch statement sytax.
switch (putz)
{
case chPageUp:
case chPageDown:
... Do stuff
break;
default:
inherited::DoKeyCommand(event);
}
Set operators:
if (adnLineTop IN newAdornment)
becomes:
if __IsSetBit__ (newAdornment,adnLineTop)
Usefull for WITH statements:
ControlTemplate& templateData = (ControlTemplate&) *itsParams;
Conversions:
Pascal C++
CHR (unsigned char)
EXIT return
LEAVE break;
BXOR ^
Member(item, TObject) item->IsMemberClass(GetClassIDFromName("TObject"))
Member statement:
if (event->IsMemberClass(GetClassIDFromName("TTracker")))
;